<docs>
## 已拒绝页面
</docs>
<template>
  <div class="con-layout rejected noPadBottom">
    <my-bread title="已拒绝" :goback="true" ref="head"></my-bread>
    <div class="content">
      <div class="resume-con" ref="resumeCon">
         <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
          <div class="resume-item" v-for="(item,index) in list" :key="index" @click="goLink(item)">
            <div class="resume-delivery">
              <span>投递给“<b>{{item.gwmc}}</b>”的简历</span>
            </div>
            <div class="resume-person clearfix">
              <span class="name">{{item.jlmc}}</span>
              <span class="link">点击查看</span>
              <p class="date">{{item.djsj}}</p>
            </div>
          </div>
         </van-list>
        </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      list: [],
      loading: false,
      finished: false,
       pageNum: 1,
      pageSize: 10
    };
  },
  methods: {
    onLoad() {
      this.$http({
        url: "/msgl/yyyck",
        method: "get",
        params: {
          tdzt: 50,
          pageNum: this.pageNum,
          pageSize: this.pageSize
        }
      }).then(res => {
        this.loading = false;
        this.finished = false;
        let _res = res.returnData;
        if (+_res.executeResult == 1) {
          this.pageNum++;
          this.list.push(..._res.gwxxCx);
          if (this.pageNum > res.pageCount) {
            // 数据加载完毕
            this.finished = true;
          }
        } else {
          this.finished = true;
        }
      });
    },
    goLink(item) {
      this.$loading = true;
      this.$http({
        url: "/dwgl/jlckBc",
        method: "post",
        data: {
          dwdjid: item.dwdjid,
          jlid: item.jlid,
          jlly: item.ckjllx,
          tdjlid: item.tdjlid,
          ckjlid: item.ckjlid
        }
      }).finally(()=>{
        this.$loading = false;
      }).then(res => {
        let _res = res.returnData;
        if (+_res.executeResult == 1) {
          this.$router.push({
            path: "/resume/resumeDetail",
            query: {
              jlid: item.jlid,
              tdjlid: item.tdjlid,
               jlly: item.ckjllx
            }
          });
        } else {
          this.alert({
            message: _res.message
          });
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.rejected{
  .content{
    padding: 0 33px;
  }
}
</style>
